diff options
author | 2021-08-18 16:40:23 -0700 | |
---|---|---|
committer | 2021-08-18 16:40:23 -0700 | |
commit | abdc26a5fc495092c865f89091bd39242fdb2b07 (patch) | |
tree | 78e71af008a042a73b1dcea8868fe43ce18f67f7 /demos/hello-next/pages/posts/[id].tsx | |
parent | 306c7dda6189521b44253eaf4696eb1ea1b1227f (diff) | |
download | bun-abdc26a5fc495092c865f89091bd39242fdb2b07.tar.gz bun-abdc26a5fc495092c865f89091bd39242fdb2b07.tar.zst bun-abdc26a5fc495092c865f89091bd39242fdb2b07.zip |
Get most of the Next.js router working
Former-commit-id: 3521bd1bb606f164f6ef1cdc4cfaae1663c22891
Diffstat (limited to 'demos/hello-next/pages/posts/[id].tsx')
-rw-r--r-- | demos/hello-next/pages/posts/[id].tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/demos/hello-next/pages/posts/[id].tsx b/demos/hello-next/pages/posts/[id].tsx new file mode 100644 index 000000000..26cb704f6 --- /dev/null +++ b/demos/hello-next/pages/posts/[id].tsx @@ -0,0 +1,18 @@ +import { useRouter } from "next/router"; +import Link from "next/link"; + +export default function Post({}) { + const router = useRouter(); + return ( + <div style={{ padding: 16 }}> + <h1>Post: {router.query.id}</h1> + <ul> + <li> + <Link href="/"> + <a>Root page</a> + </Link> + </li> + </ul> + </div> + ); +} |